package com.cares.business.procedure.action;

import com.cares.business.procedure.service.ProcedureService;
import com.cares.common.action.DefaultAction;

public class ProcedureAction extends DefaultAction{
	
	private static final long serialVersionUID = 1L;

	private ProcedureService procedureService;
   
	public String execute(){   
	    System.out.println("测试存储过程");   
	    
	    try {
			@SuppressWarnings("unused")
			Object result = procedureService.doCallProceReturnValue(new String[]{"工作流_id0001", "jsflow_name0001", "task_id0001", "task_name0001"}, 
					"testProReturn", new String[]{"cares","cares"},"p_result");
			System.out.println("存储过程测试结束"); 

			//PrintWriter out = super.getResponse().getWriter();
			// out.print("<script>alert('"+result+"')</script>");
            // out.print("<script>window.location.href='/JSflow/suc.jsp'</script>");
           //  out.flush();
           //  out.close();
			return "succ";  
		} catch (Exception e) {
			e.printStackTrace();
		}
		return "fail";   
	    
	}

	public ProcedureService getProcedureService() {
		return procedureService;
	}

	public void setProcedureService(ProcedureService procedureService) {
		this.procedureService = procedureService;
	}

}
